//
//  VIPIMTeamManager.m
//  TTProduct
//
//  Created by My mac on 2019/7/31.
//  Copyright © 2019年 TTProduct. All rights reserved.
//

#import "VIPIMTeamManager.h"

@implementation VIPIMTeamManager

- (void)joinRoomCompletion:(VIPCompletionHandler)completion; { // 进入房间
    self.status = VIPSignalStateLoginOK;
    if (completion) completion(nil);
}

- (void)sendMessageCompletion:(VIPCompletionHandler)completion {
    NSError *error = nil;
    [self sendMessageType:NIMSessionTypeTeam error:&error];
    VIPMessage *message = [self messageWithEcode:error.code];
    if (!completion) return;
    completion(message);
}

- (void)leaveRoomCompletion:(VIPCompletionHandler)completion { // 退出房间
    if (completion) completion(nil);
}

static VIPIMTeamManager* _instance = nil;
+ (instancetype)shareManager {
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        _instance = [[super allocWithZone:NULL] init];
        [_instance setupIM];
    });
    return _instance ;
}

+ (id)allocWithZone:(struct _NSZone *)zone {
    return [VIPIMTeamManager shareManager];
}

- (id)copyWithZone:(struct _NSZone *)zone {
    return [VIPIMTeamManager shareManager];
}

- (NSString *)signaingName {
    return @"网易 群组";
}

@end
